import React, { useRef } from 'react';
import './index.less';
import FlawMapAllLot from './component/flaw-map';
import RollTable from './component/slit-table';

const FlawMapLot: React.FC = () => {
  const chartsRef = useRef<any>(null);

  // 查询获得的数据
  const layerIdSearch = (info: any) => {
    // console.log('综合Map查询参数：info', info);
    if (Object.keys(info).length === 0) {
      chartsRef.current.getEmptyEchart();
      return;
    }
    chartsRef.current.drawFlawDotAndRect(info);
  };

  return (
    <>
      <div className="synthesize-map-page">
        <FlawMapAllLot onRef={chartsRef}></FlawMapAllLot>
        <RollTable layerIdSearch={layerIdSearch}></RollTable>
      </div>
    </>
  );
};

export default FlawMapLot;
